package com.singing.manager;

import com.singing.model.Command;

import java.util.ArrayList;
import java.util.List;

public class SingerManager extends BaseManager {

    // 歌手列表
    private static final int LIST = 1;

    // 歌手增删改
    private static final int ADD = 2;

    // 歌手增删改
    private static final int UPDATE = 3;

    // 歌手增删改
    private static final int REMOVE = 4;

    public SingerManager(String title, List<Command> commandList) {
        super(title, commandList);
    }


    @Override
    public int processCommand(int command) {
        switch (command) {
            case LIST:
                showSingerList();
                break;
            case ADD:
                showAddSinger();
                break;
            case UPDATE:
                showUpdateSinger();
                break;
            case REMOVE:
                showRemoveSinger();
                break;
        }
        return command;
    }


    private void showSingerList() {
        // TODO
        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        new SingerListManager("歌手列表", commandList).manage();
    }

    private void showRemoveSinger() {
        // TODO

        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        commandList.add(new Command(2, "删除"));
        new SingerRemoveManager("歌手删除", commandList).manage();
    }

    private void showUpdateSinger() {
        // TODO

        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "重新加载"));
        commandList.add(new Command(2, "修改"));
        new SingerUpdateManager("歌手修改", commandList).manage();
    }

    private void showAddSinger() {
        List<Command> commandList = new ArrayList<>();
        commandList.add(new Command(1, "输入歌手信息"));
        new SingerAddManager("歌手添加", commandList).manage();
    }


}
